Skip to content

Respect HTTP method for links path in EndpointRequest.toAnyEndpoint()#50124

Closed
nikitanagar08 wants to merge 2 commits into
spring-projects:mainfrom
nikitanagar08:fix/issue-50095-endpoint-request-http-method
Closed

Respect HTTP method for links path in EndpointRequest.toAnyEndpoint()#50124
nikitanagar08 wants to merge 2 commits into
spring-projects:mainfrom
nikitanagar08:fix/issue-50095-endpoint-request-http-method

Conversation

@nikitanagar08

Copy link
Copy Markdown

Fixes gh-50095

EndpointRequest.toAnyEndpoint().withHttpMethod() now applies the configured HTTP method to the links path in addition to endpoint paths.

Previously, calling toAnyEndpoint().withHttpMethod(POST) restricted endpoint paths to POST but the links path (/actuator and /actuator/) still matched any HTTP method.

Changes:

  • Updated getLinksMatchers() to accept and use httpMethod parameter
  • Modified LinksServerWebExchangeMatcher to accept httpMethod in constructor
  • Strengthened tests to verify links path respects configured HTTP method
  • Both servlet and reactive implementations updated

The toLinks() matcher continues to accept any HTTP method to maintain backward compatibility.

Test Results:
All EndpointRequest tests pass, including:

  • toAnyEndpointWithHttpMethodShouldRespectRequestMethod (servlet & reactive)

Fixes spring-projectsgh-50096

RecordParameterPropertyDescriptor.isMarkedAsNested now checks both
the record component and the getter method for @NestedConfigurationProperty,
matching the behavior of JavaBeanPropertyDescriptor and
ConstructorParameterPropertyDescriptor.

This ensures consistency across all property descriptor types and
allows @NestedConfigurationProperty to work correctly when placed on
record accessor methods.
Fixes spring-projectsgh-50095

EndpointRequest.toAnyEndpoint().withHttpMethod() now applies the
configured HTTP method to the links path in addition to endpoint paths.

Previously, calling toAnyEndpoint().withHttpMethod(POST) restricted
endpoint paths to POST but the links path (/actuator and /actuator/)
still matched any HTTP method.

Changes:
- Updated getLinksMatchers() to accept and use httpMethod parameter
- Modified LinksServerWebExchangeMatcher to accept httpMethod in constructor
- Strengthened tests to verify links path respects configured HTTP method
- Both servlet and reactive implementations updated

The toLinks() matcher continues to accept any HTTP method to maintain
backward compatibility.
@wilkinsona

Copy link
Copy Markdown
Member

Duplicates #50095.

@wilkinsona wilkinsona closed this Apr 19, 2026
@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: duplicate A duplicate of another issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants